package stringmethod;

import java.util.Scanner;

/**
 * @author げっしょく
 * @date 2021/7/5
 */
public class Demo1<i> {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        String x1;String x2;String x3;
        String s1 = "shizeng123";
        String s2 = "shi1873647314";
        String s3;String s4;
        System.out.println("0.直接登入账号         1.创建账号");
        int sum = sc.nextInt();
        if(sum == 1) {
            while(true) {
                System.out.println("请输入你要创建的账号：");
                x1 = sc.next();
                System.out.println("请输入你要创建的密码：");
                x2 = sc.next();
                System.out.println("确认您的密码：");
                x3=sc.next();
                if(x2.equals(x3)){
                    System.out.println("创建成功");
                    System.out.println("登入成功");
                    break;
                }else{
                    System.out.println("两次密码不同，请重新输入账号密码：");
                }
            }
        }
        if(sum == 0) {

            for (int i = 0; i <= 3; i++) {
                System.out.println("你还有" + (3 - i) + "次机会");
                System.out.println("请输入你的账号：");
                s3 = sc.next();
                System.out.println("请输入你的密码：");
                s4 = sc.next();
                if (s1.equals(s3) && s2.equals(s4)) {
                    System.out.println("登入成功");
                    break;
                } else {
                    System.out.println("密码或账号错误,你是傻逼吗这多可以错");
                    if (i == 2) {
                        System.out.println("您已连续三次输入错误，冻结您的账号一天；");
                        break;
                    }
                }
            }
        }
    }


}
